Release 10.1A: OpenEdge Development:
Programming Interfaces


Writing temp-table data to XML

Having taken a tour through several scenarios for reading XML data, examples of writing XML data will be mostly familiar. If you wish to experiment with these code samples, the best way to examine your results is to open up the XML data files and see how your changes affected the XML.

The following code example creates a static temp-table, copies a subset of Customer records to it, then serializes the data to an XML file.

/* pi-tfx-write-3.p */ 
/* Populates a temp-table with a subset of Customer records and writes it  
   to an XML file. */ 
   
{pi-tfx-parameterVarDefs.i} 
{pi-tfx-writeSetup-3.i} 
     
DEFINE VARIABLE returnValue AS LOGICAL NO-UNDO. 
FOR EACH Customer WHERE CustNum < 4: 
    CREATE ttCust. 
    BUFFER-COPY Customer TO ttCust. 
END. 
ASSIGN 
     cTargetType = "FILE" 
     cFile = "ttCust.xml"  
     lFormatted = YES 
     cEncoding = ? 
     cSchemaLocation = ? 
     lWriteSchema = NO 
     lMinSchema = NO. 
  
returnValue = TEMP-TABLE ttCust:WRITE-XML(cTargetType, cFile, lFormatted, 
                                          cEncoding, cSchemaLocation,  
                                          lWriteSchema, lMinSchema). 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095